<template>
	<view>
		<view class="nav_box" :style="{background: navColor}">
			<view :style="{height: `${s}px`}"></view>
			<view class="navBar" :style="{height: `${n}px`}">
				<view class="nav_content" :style="{height: `${h}px`}">
					<slot></slot>
				</view>
			</view>
		</view>
		<view :style="{height: `${s+n}px`}"></view>
	</view>
	
</template>

<script>
	export default {
		name: "com-nav-bar",
		props: {
			//导航栏颜色
			navColor: {
				type: String,
				default: '#171525'
			}
		},
		data() {
			return {
				s: this.statusBar, //状态栏高度
				n: (this.menu.top - this.statusBar) * 2 + this.menu.height, //导航栏高度
				h: this.menu.height //胶囊高度
			};
		},
		mounted() {
			console.log(this.s)
			console.log(this.n)
			console.log(this.h)
		}
	}
</script>

<style>
	.nav_box {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 999;
	}

	.navBar {
		display: flex;
		align-items: center;
	}

	.nav_content {
		width: 100%;
		display: flex;
		align-items: center;
	}
</style>
